import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;

public class Test {


    public static void main(String[] args) {
        TestHeap testHeap = new TestHeap();
        int[] arr = {27,15,19,18,28,34,65,49,25,37};
        testHeap.init(arr);
        testHeap.createHeap();
        testHeap.sortHeap();
        System.out.println();
    }

    public static void main2(String[] args) {
//        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>(new Comparator<Integer>() {
//            @Override
//            public int compare(Integer o1, Integer o2) {
//                return- o1.compareTo(o2);
//            }
//        });
        int[] a = new int[0];
        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>((o1, o2) -> -o1.compareTo(o2));
        priorityQueue.offer(1);
        priorityQueue.offer(3);
        priorityQueue.offer(-1);
        System.out.println(Arrays.toString(priorityQueue.toArray()));
        System.out.println(priorityQueue.poll());
        System.out.println(priorityQueue.poll());
    }
    public static void main1(String[] args) {
        TestHeap testHeap = new TestHeap();
        int[] arr = {27,15,19,18,28,34,65,49,25,37};
        testHeap.init(arr);
        testHeap.createHeap();
//        testHeap.push(80);
        System.out.println(testHeap.pop());
        System.out.println("-------");
    }
}
